//
//  ZCVoiceView.m
//  BaiSi
//
//  Created by 张灿 on 16/5/4.
//  Copyright © 2016年 张灿. All rights reserved.
//

#import "ZCVoiceView.h"
#import <UIImageView+WebCache.h>


@interface ZCVoiceView ()

@property (weak, nonatomic) IBOutlet UIImageView *imageView;

@property (weak, nonatomic) IBOutlet UILabel *playCount;

@property (weak, nonatomic) IBOutlet UILabel *playTime;

@property (nonatomic, strong) NSString *voiceuri;
@end

@implementation ZCVoiceView

- (void)setItem:(ZCThemeItem *)item
{
    [super setItem:item];
    
    [self.imageView sd_setImageWithURL:[NSURL URLWithString:item.image0]];
    
    self.playCount.text = [NSString stringWithFormat:@"%@播放", item.playcount];
    
    NSString *time = [NSString stringWithFormat:@"%02ld:%02ld", item.voicetime.integerValue / 60, item.voicetime.integerValue % 60];
    self.playTime.text = time;
    
    self.voiceuri = item.voiceuri;
}
- (IBAction)playClick:(UIButton *)sender {
    sender.selected = !sender.selected;

}

@end
